package com.yqd.lesson.actor.one

import akka.actor.{ActorRef, ActorSystem}

/*
  Actor 最基本的用法
 */
object Main extends App{

  //用户创建的顶级actor的监管者
  val system: ActorSystem = ActorSystem("akka")

  //创建akka://akka/user/printerActor
  val printer: ActorRef = system.actorOf(Receiver.props, "printerActor")
  val tom: ActorRef = system.actorOf(Sender.props(printer),"tom")
  val jerry: ActorRef = system.actorOf(Sender.props(printer),"jerry")

  tom ! "hello"
  jerry ! "hello"

}
